package com.fupeng.netease;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created by lecky on 2016/8/2 0002.
 */
public class Demo {
    private static volatile boolean time=true;
    private static volatile  Set<String> set = new HashSet<>();
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(5*1000);
                    System.out.println(set.size());
                } catch (InterruptedException e) {
                }
            }
        });
        thread.start();
            while (in.hasNextLine()) {//注意while处理多个case
                String nextline = in.nextLine();
                String[] line = nextline.split(" ");
                for(String str : line)
                    set.add(str);
            }
    }
}
